package com.haulmont.asu.entity;

import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.cuba.security.entity.User;

import javax.persistence.*;

/**
 * Author: Sergey42
 * Date: 16.10.13 22:06
 */
@NamePattern("%s|name")
@Table(name = "ASU_DEPARTMENT")
@Entity(name = "asu$Department")
public class Department extends StandardEntity {

    private static final long serialVersionUID = -1351800548107662288L;

    @Column(name = "NUMBER", length = 20)
    protected String number;

    @Column(name = "NAME", length = 50)
    protected String name;

    @ManyToOne
    @JoinColumn(name = "CAPTAIN_ID")
    protected User captain;

    @Column(name = "STUFF_COUNT")
    protected Integer stuffCount;

    @ManyToOne
    @JoinColumn(name = "DEPARTMENT_PROFILE_ID")
    protected DepartmentProfile departmentProfile;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public User getCaptain() {
        return captain;
    }

    public void setCaptain(User captain) {
        this.captain = captain;
    }

    public Integer getStuffCount() {
        return stuffCount;
    }

    public void setStuffCount(Integer stuffCount) {
        this.stuffCount = stuffCount;
    }

    public DepartmentProfile getDepartmentProfile() {
        return departmentProfile;
    }

    public void setDepartmentProfile(DepartmentProfile departmentProfile) {
        this.departmentProfile = departmentProfile;
    }
}
